/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ImagemFundo;

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.image.BufferedImage;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.border.Border;

/**
 *
 * @author MAYCON
 */
public class ImagemFundoLogin implements Border {
    public BufferedImage back;
    
    public ImagemFundoLogin(){
        try{
            URL imagePath = new URL (getClass().getResource("../Imagem/fundologin.png").toString());
            back = ImageIO.read(imagePath);
        } catch (Exception ex){
    }
    }
    
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height){
        g.drawImage(back, (x + (width - back.getWidth())/2),(y + (height - back.getHeight())/2),null);
    }
    
    public Insets getBorderInsets(Component c){
        return new Insets(0,0,0,0);
    }
    
    public boolean inBorderOpaque(){
        return false;
    }

    @Override
    public boolean isBorderOpaque() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
}
